package com.fs;

import net.sourceforge.pinyin4j.PinyinHelper;

/**
 * @author shuai.fang
 * @date：2017-08-13
 * @description：
 */
public class ChineseTest {

	public static void main(String[] args) throws InterruptedException {
		int a = (int)(4*Math.pow(16, 3)+14*Math.pow(16, 2)); // 汉字ASCII码最小值
		System.out.println(a);
		int b = (int)(9*Math.pow(16, 3)+15*Math.pow(16, 2)+10*Math.pow(16, 1))+5;  // 汉字ASCII码最大值
		System.out.println(b);

		int j = 0;
		for(int i=a;i<=b;i++){
			j++;
			char c = (char) i;
			String str = new String(String.valueOf(c));
			String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(str.toCharArray()[0]);
			if (pinyinArray != null) {
				String pinyin = pinyinArray[0];
				System.out.format("%s\t%s\t%s\n", str, pinyin.substring(0, pinyin.length() - 1), pinyin.substring(pinyin.length() - 1));
			}
//			System.out.println((char)i); //ASCII码转换为字符（汉字）
//			if(j%10==0){
//				System.out.println();
//				j=0;
//			}
		}
	}

}
